﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace System.Peppers.ShellExtensions
{
    [StructLayout(LayoutKind.Sequential)]
    internal struct MENUITEMINFO
    {
        internal uint cbSize;
        internal uint fMask;
        internal uint fType;
        internal uint fState;
        internal uint wID;
        internal IntPtr hSubMenu;
        internal IntPtr hbmpChecked;
        internal IntPtr hbmpUnchecked;
        internal IntPtr dwItemData;
        [MarshalAs(UnmanagedType.LPStr)]
        internal string dwTypeData;
        internal uint cch;
        internal IntPtr hbmpItem;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    internal struct CMINVOKECOMMANDINFO
    {
        internal uint cbSize;
        internal uint fMask;
        internal IntPtr hwnd;
        internal IntPtr verb;
        [MarshalAs(UnmanagedType.LPStr)]
        internal string parameters;
        [MarshalAs(UnmanagedType.LPStr)]
        internal string directory;
        internal int Show;
        internal uint HotKey;
        internal IntPtr hIcon;
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct FORMATETC
    {
        internal CLIPFORMAT cfFormat;
        internal IntPtr ptd;
        internal DVASPECT dwAspect;
        internal int lindex;
        internal TYMED tymed;
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct STGMEDIUM
    {
        public uint tymed;
        public IntPtr hGlobal;
        public object pUnkForRelease;
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct SHELLDETAILS
    {
        public int fmt;
        public int cxchar;
        public IntPtr str;
    }

    [StructLayout(LayoutKind.Explicit)]
    internal struct STRRET_STRUCT
    {
        [FieldOffset(0)]
        public STRRET uType;
        [FieldOffset(32)]
        [MarshalAs(UnmanagedType.LPWStr)]
        public string pOleStr;
        [FieldOffset(32)]
        public uint uOffset;
        [FieldOffset(32)]
        public IntPtr cStr;
    }
}